<?php $site_model=$this->sitedata;
      $updated_data_name=$this->admindata;
?>
<div id="pad-wrapper">
     <div class="row pagelist-header">
        <h3><?php echo $this->translate("site_menu")." ".$this->translate("detail_title"); ?></h3>
     </div>
    <div class="row-fluid ">
        <div class="pull-right">
            <a class="btn-flat new-product" href="<?php echo $this->url(array('module' => 'default', 'controller' => 'site', 'action' => 'list'), null, TRUE); ?>"><?php echo $this->translate("detail_back"); ?></a>
        </div>              
    </div>
    <div class="row-fluid form-wrapper">
        
        
        <!---left column-->
        <div class="span column span5 site">
            <div class="sub_main">
                <div class="detail_label"><?php echo $this->translate("site_frm_name"); ?>: </div>
                <div class="detail_data"><?php echo ucfirst($site_model['site_name']);?></div>
            </div>
            
            <div class="sub_main">
                <div class="detail_label"><?php echo $this->translate("site_frm_phone_1"); ?>: </div>
                <div class="detail_data"><?php echo $site_model['site_phone_1'];?></div>
            </div>
            <?php if($site_model['site_phone_2']!=''):?>
            <div class="sub_main">
                <div class="detail_label"><?php echo $this->translate("site_frm_phone_2"); ?>: </div>
                <div class="detail_data"><?php echo $site_model['site_phone_2'];?></div>
            </div>
            <?php endif;?>
             <?php if($site_model['site_phone_3']!=''):?>
            <div class="sub_main">
                <div class="detail_label"><?php echo $this->translate("site_frm_phone_3"); ?>: </div>
                <div class="detail_data"><?php echo $site_model['site_phone_3'];?></div>
            </div>
             <?php endif;?>
            <div class="sub_main">
                <div class="detail_label"><?php echo $this->translate("sitemap_frm_image"); ?>: </div>
                <div class="detail_data">
                    <?php
                    if ($site_model['site_map'] != ''):
                        if (file_exists($this->UPLOAD_PATH . "site/" . $site_model['site_map'])):
                            ?> 
                            <img src="<?php echo $this->PUBLIC_PATH . "upload/site/" . $site_model['site_map'] ?>" height="100" width="100">
                        &nbsp; <a class="label label-add" title="View" target="_blank" href="<?php echo $this->url(array('controller' => 'site', 'action' => 'download', 'site_id' => $site_model['site_id']), null, true);?>">
                         view </a>
                                <?php
                        endif;
                    endif;
                    ?>
                </div>
            </div>
            <div class="sub_main">
                <div class="detail_label"><?php echo $this->translate("site_frm_email"); ?>: </div>
                <div class="detail_data"><?php echo $site_model['site_email'];?></div>
            </div>
            
            <div class="sub_main">
                <div class="detail_label"><?php echo $this->translate("site_frm_company"); ?>: </div>
                <div class="detail_data"><?php echo $site_model['com_name'];?></div>
            </div>
            
            <div class="sub_main">
                <div class="detail_label"><?php echo $this->translate("site_frm_type"); ?>: </div>
                <div class="detail_data"><?php echo $site_model['child_name'];?></div>
            </div>
            
            <div class="sub_main">
                <div class="detail_label"><?php echo $this->translate("site_frm_address"); ?>: </div>
                <div class="detail_data"><?php echo $site_model['site_address'];?></div>
            </div>
            
            <div class="sub_main">
                <div class="detail_label"><?php echo $this->translate("site_frm_city"); ?>: </div>
                <div class="detail_data"><?php echo $site_model['site_city'];?></div>
            </div>
           
            <div class="sub_main">
                <div class="detail_label"><?php echo $this->translate("site_frm_zipcode"); ?>: </div>
                <div class="detail_data"><?php echo $site_model['site_postal_code'];?></div>
            </div>
            
            <div class="sub_main">
                <div class="detail_label"><?php echo $this->translate("site_frm_country"); ?>: </div>
                <div class="detail_data"><?php echo $site_model['country_name'];?></div>
            </div>
            
            <div class="sub_main">
                <div class="detail_label"><?php echo $this->translate("site_frm_guard"); ?>: </div>
                <div class="detail_data"><?php if($site_model['site_guard']=='1'):echo 'Yes';else:echo 'No';endif;?></div>
            </div>
            <?php if($site_model['site_digicode']!=''):?> 
            <div class="sub_main">
                <div class="detail_label"><?php echo $this->translate("site_frm_digicode"); ?>: </div>
                <div class="detail_data"><?php echo $site_model['site_digicode'];?></div>
            </div>
            <?php endif;?>
            
            <div class="sub_main">
                <div class="detail_label"><?php echo $this->translate("site_frm_keysafe"); ?>: </div>
                <div class="detail_data"><?php if($site_model['site_keysafe']=='1'):echo 'Yes';else:echo 'No';endif;?></div>
            </div>
            
            <?php if($site_model['site_code']!=''):?> 
            <div class="sub_main">
                <div class="detail_label"><?php echo $this->translate("site_frm_code"); ?>: </div>
                <div class="detail_data"><?php echo $site_model['site_code'];?></div>
            </div>
            <?php endif;?>
            
             <?php if($site_model['site_key_safe_loc']!=''):?> 
            <div class="sub_main">
                <div class="detail_label"><?php echo $this->translate("site_frm_key_safe_loc"); ?>: </div>
                <div class="detail_data"><?php echo $site_model['site_key_safe_loc'];?></div>
            </div>
            <?php endif;?>
            
            <?php if($site_model['site_vulnerabilities']!=''):?> 
            <div class="sub_main">
                <div class="detail_label"><?php echo $this->translate("site_frm_vulnerabilities"); ?>: </div>
                <div class="detail_data"><?php echo $site_model['site_vulnerabilities'];?></div>
            </div>
            <?php endif;?>
           

            <div class="sub_main">
                <div class="detail_label"><?php echo $this->translate("site_frm_createdate"); ?>: </div>
                <div class="detail_data"><?php echo date('Y-m-d',  strtotime($site_model['site_createddate']));?></div>
            </div>
            
            <div class="sub_main">
                <div class="detail_label"><?php echo $this->translate("site_frm_updatedate"); ?>: </div>
                <div class="detail_data"><?php echo date('Y-m-d',  strtotime($site_model['site_updateddate']));?></div>
            </div>
            
            <div class="sub_main">
                <div class="detail_label"><?php echo $this->translate("site_frm_updated_by"); ?>: </div>
                <div class="detail_data">
                   <?php echo $updated_data_name;?>
                </div>
            </div>
            
             <div class="sub_main">
                <div class="detail_label"><?php echo $this->translate("site_frm_status"); ?>: </div>
                <div class="detail_data">
                    <?php echo ( $site_model['site_status'] == 1 ) ? 'Active' : 'Inactive'; ?>
                </div>
            </div>
            
        </div>
        
    
    
     <!-- Right Column -->
        <div class="span7">
            <h3>Hours</h3>
            <br/>
             <table class="table table-hover">
                    <thead>
                        <tr>
                            <th class="col-md-3 ">Day</th>
                            <th class ="col-md-3">Time of commissioning</th>
                            <th class ="col-md-3">Time of decommissioning</th>
                            <th class ="col-md-3">Date last action</th>
                        </tr>
                    </thead>
                    <tbody>
                        <?php 
                         foreach ($this->weekarray as $key =>$value):
                         //echo '<pre>';
                       //  print_r($this->sitehoursData);
                        // print_r($this->weekarray);
                        if($this->mode == 'Edit' || count($this->sitehoursData)!=0): 
                          //  echo 'in';
                            if(array_key_exists($key, $this->sitehoursData)):
                                $checked = "checked";
                                $date_val = $this->sitehoursData[$key]['site_hr_date'];
                                $site_hr_commision_hr = $this->sitehoursData[$key]['site_hr_commision_hr'];
                                $site_hr_commision_mint = $this->sitehoursData[$key]['site_hr_commision_mint'];
                                $site_hr_decommision_hr = $this->sitehoursData[$key]['site_hr_decommision_hr'];
                                $site_hr_decommision_mint = $this->sitehoursData[$key]['site_hr_decommision_mint'];
                            else:
                                $checked = "";
                                $date_val = ""; 
                                $site_hr_commision_hr = "";
                                $site_hr_commision_mint = "";
                                $site_hr_decommision_hr = "";
                                $site_hr_decommision_mint = "";
                            endif;
                        else:
                             $checked = "";
                             $date_val = ""; 
                             $site_hr_commision_hr = "";
                             $site_hr_commision_mint = "";
                             $site_hr_decommision_hr = "";
                             $site_hr_decommision_mint = "";
                             
                       endif;
                         
                         
                         
                         ?>
                        <tr>
                            <td>
                                <div class="frm_left"><label for="day_chk_<?php echo $key;?>"><?php echo $value;?></label></div>
                                <div class="frm_right">
                                    <input disabled="disabled" type="checkbox" <?php echo  $checked; ?> name="site_hr_day[]" id="day_chk_<?php echo $key;?>" value="<?php echo $key;?>" >
                                </div>
                            </td>
                            <td>
                                <select disabled="disabled"  name="site_hr_commision_hr[]" id="hours_<?php echo $key;?>" class="hours_cls">
                                    <?php foreach ($this->hoursarray as $hkey =>$hvalue):
                                        if($site_hr_commision_hr == $hkey){
                                           $selected = "selected";
                                        }else{
                                            $selected = "";
                                        }
                                        
                                    ?>
                                    <option value="<?php echo $hkey;?>" <?php echo $selected;?> ><?php echo $hvalue;?></option>
                                    <?php endforeach;?>
                                </select>
                                <select disabled="disabled" name="site_hr_commision_mint[]" id="minutes_<?php echo $key;?>" class="mint_cls">
                                    <?php foreach ($this->minutesarray as $mkey =>$mvalue):
                                            if($site_hr_commision_mint == $mkey){
                                               $selected1 = "selected";
                                            }else{
                                               $selected1 = "";
                                            } ?>
                                    <option value="<?php echo $mkey;?>"  <?php echo $selected1;?> ><?php echo $mvalue;?></option>
                                    <?php endforeach;?>
                                </select>
                            </td>
                            <td>
                               <select disabled="disabled" name="site_hr_decommision_hr[]" id="des_hours_<?php echo $key;?>" class="hours_cls">
                                    <?php foreach ($this->hoursarray as $hkey =>$hvalue):
                                            if($site_hr_decommision_hr == $hkey){
                                               $selected2 = "selected";
                                            }else{
                                               $selected2 = "";
                                            } 
                                     ?>
                                    <option value="<?php echo $hkey;?>"  <?php echo $selected2;?> ><?php echo $hvalue;?></option>
                                    <?php endforeach;?>
                                </select>
                                <select disabled="disabled" name="site_hr_decommision_mint[]" id="des_minutes_<?php echo $key;?>" class="mint_cls">
                                    <?php foreach ($this->minutesarray as $mkey =>$mvalue):
                                            if($site_hr_decommision_mint == $mkey){
                                               $selected3 = "selected";
                                            }else{
                                               $selected3 = "";
                                            } 
                                    ?>
                                    <option value="<?php echo $mkey;?>"  <?php echo $selected3;?>><?php echo $mvalue;?></option>
                                    <?php endforeach;?>
                                </select>
                           
                            </td>
                            <td><input disabled="disabled" class="date_last_action datepicker" value="<?php echo $date_val;?>" type="text" name="site_hr_date[]" id="date_last_action_<?php echo $key;?>"></td>
                          </tr>
                        <?php endforeach;?>
                    
                    </tbody>
             </table>
            
        </div>
     
     
    </div>
</div>

<div style="clear: both"></div>
<a class="back_bottom" href="<?php echo $this->url(array('module' => 'default', 'controller' => 'site', 'action' => 'list'), null, TRUE); ?>"><?php echo $this->translate("detail_back"); ?></a>
